import React, { useState } from "react";

import style from "../index.module.scss";
import { request } from "../../api/request";

export const FetchPage: React.FC = () => {
  const [data, setData] = useState<null | object>(null);

  const fetchData = () => {
    request.get("/article/recommend").then((data) => {
      setData(data);
    });
  };
  return (
    <div>
      <span className={style.link} onClick={fetchData}>
        fetchData
      </span>
      <div>{JSON.stringify(data)}</div>
    </div>
  );
};
